<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- viewport 设置 -->
  <title>发票信息</title>
  <script src="./dist/moment.js"></script>
  <style>
    body {
      padding: 32px 24px 24px 24px;
    }

    h2 {
      width: 100%;
      text-align: center;
    }

    .subtitle {
      font-size: 18px;
      color: #333;
      text-align: center;
      margin-bottom: 14vw;
      /* 使用 vw 单位进行垂直间距设置 */
    }

    .label {
      color: #666;
      font-size: 16px;
    }

    .value {
      color: #333;
      font-size: 16px;
      margin-left: 50px;
    }

    .invoice-info {
      font-size: 14px;
      margin-bottom: 3vw;
      /* 使用 vw 单位进行垂直间距设置 */
    }

    .footer {
      position: absolute;
      padding: 32px;
      bottom: 0px;
      font-size: 14px;
      text-align: center;
      color: #999;
      /* 使用 vw 单位进行垂直间距设置 */
    }

    /* 媒体查询：针对小屏幕设备 */
    @media screen and (max-width: 600px) {
      .subtitle {
        font-size: 12px;
      }

      .invoice-info {
        font-size: 14px;
      }

      .footer {
        position: absolute;
        padding: 32px;
        bottom: 0px;
        font-size: 14px;

      }
    }
  </style>
</head>

<body>

  <h2>发票信息</h2>
  <div class="subtitle">
    <p style="font-size:16px">以下信息仅为发票二维码所含信息，并不代表查验发票真伪的结果。</p>
  </div>
  <div class="invoice-info">
    <p>
      <span class="label">发票号码</span>
      <span class="value" id="no"></span>
    </p>
    <p>
      <span class="label">合计金额</span>
      <span class="value" id="amount"></span>
    </p>
    <p>
      <span class="label">开票日期</span>
      <span class="value" id="date"></span>
    </p>
  </div>
  <div class="footer">
    <p>如需查验发票真伪，请通过税务机关提供的官方渠道进行查验。</p>
  </div>

</body>

<script>
  const queryString = window.location.search
  const urlParams = new URLSearchParams(queryString)
  const no = urlParams.get('no')
  const amount = urlParams.get('amount')
  const date = urlParams.get('date')
  console.log(no)
  document.getElementById('no').innerHTML = no
  document.getElementById('amount').innerHTML = `¥${amount}(含税)`
  document.getElementById('date').innerHTML = moment(date).format('YYYY.MM.DD')
</script>

</html>